<template>
  <div class="cardList">
    <div class="cardContainer">
      <div class="cardContent">
        <div class="img">
          <img :src="articleList.coverImgUrl" alt />
        </div>
        <div class="Individual">
          <div class="title">
            <a :href="articleList.linkUrl">
              <p>{{articleList.title}}</p>
            </a>
          </div>
          <div class="time">
            <span>{{articleList.authorName}}</span>
            <span style="margin-left:20px">{{articleList.gmtCreated | formatDate}}</span>
          </div>
          <div class="artical">
            <p>{{articleList.description}}</p>
          </div>
        </div>
      </div>
      <el-divider></el-divider>
    </div>
  </div>
</template>

<script>
import { formatDate } from "../../utils/tools";
export default {
  props: ["articleList"],
  data() {
    return {
      list: {},
    };
  },
  filters: {
    formatDate(time) {
      let date = new Date(time);
      return formatDate(date, "yyyy-MM-dd hh:mm");
    }
  },
};
</script>

<style>
a {
  text-decoration: none;
  color: black;
}
.cardList {
  width: 100%;
}
.cardList .cardContainer {
  width: 100%;
  background: #fff;
  height: 300px;
  cursor: pointer;
}
.cardList .cardContainer .cardContent {
  width: 90%;
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}
.cardList .cardContainer .cardContent .img {
  width: 20%;
  line-height: 200px;
  height: 200px;
}
.cardList .cardContainer .cardContent .img img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
}
.cardList .cardContainer .cardContent .Individual {
  width: 70%;
  line-height: 300px;
}
.cardList .cardContainer .cardContent .Individual .title p {
  font-family: PingFangSC;
  font-weight: 400;
  font-size: 19px;
  color: rgba(0, 0, 0, 1);
  font-style: normal;
  letter-spacing: 0px;
  line-height: 39px;
}
.cardList .cardContainer .cardContent .Individual .time {
  line-height: 29px;
  height: 34px;
}
.cardList .cardContainer .cardContent .Individual .time span {
  font-family: PingFangSC;
  font-weight: 400;
  font-size: 15px;
  color: rgb(156, 156, 156);
  letter-spacing: 0px;
  line-height: 34px;
}
.cardList .cardContainer .cardContent .Individual .artical p {
  font-weight: 400;
  font-size: 16px;
  color: rgb(156, 156, 156);
  font-style: normal;
  letter-spacing: 0px;
  line-height: 34px;
  text-decoration: none;
}
.el-divider--horizontal {
  margin: 0 !important;
}
@media screen and (max-width: 1059px) {
  .cardList .cardContainer .cardContent .Individual .artical p {
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    display: -webkit-box;
  }
}
@media screen and (max-width: 788px) {
  .cardList .cardContainer .cardContent {
    width: 96%;
  }
}
@media screen and (max-width: 640px) {
  .cardList .cardContainer .cardContent {
    display: block;
  }
  .cardList .cardContainer .cardContent .img {
    width: 90%;
    margin: 0 auto;
  }
  .cardList .cardContainer .cardContent .Individual {
    margin: 0 auto;
    width: 90%;
    height: 300px;
  }
  .cardList .cardContainer {
    height: auto;
  }
}
</style>